<?php if (! defined('APPPATH')) die('No direct script access allowed');
/**
 * RENARTI IK
 * An open source application development framework for PHP 5.2.0 or newer
 *
 * @package		RtiFramework
 * @author		Nauris Dambis <nauris.dambis@renarti.com>
 * @copyright	Copyright (c) 2012, RENARTI IK.
 * @license		http://renarti.com/#license
 * @link		http://renarti.com
 * @since		Version 1.0
 */

class RtiConfig
{
	public $section;
	
	/**
	 * Remember current section/key of loaded vars
	 *
	 * @access	public
	 * @param	string $key
	 * @return	RtiConfig
	 */
	public function setSection($key = '')
	{
		$this->section = $key;	
		return $this;		
	}
	
	/**
	 * Get current section/key
	 *
	 * @access	public
	 * @return	mixed
	 */
	public function items()
	{
		$vars = Rti::getLoadedVars();
		return (isset($vars[$this->section]))? $vars[$this->section] : FALSE; 
	}
	
	/**
	 * Get current section/key value
	 *
	 * @access	public
	 * @param	string $key
	 * @return	mixed
	 */
	public function get($key)
	{
		$vars = Rti::getLoadedVars();
		return (isset($vars[$this->section][$key]))? $vars[$this->section][$key] : FALSE;
	}
}

/* End of file RtiConfig.php */
/* Location: ./system/core/RtiConfig.php */
